package com.link2room.bumblebee.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author sqj88
 * @date 2017/11/17 20:39
 */
@Entity
@Table(name = "tag_base")
@DynamicInsert
public class TagBase extends BaseEntity{
    private String tagCode;
    private String tagName;
    private String tagNameEn;
    private String tagType;
    private String descript;
    private String descriptEn;

    @Basic
    @Column(name = "tag_code", nullable = true, length = 32)
    public String getTagCode() {
        return tagCode;
    }

    public void setTagCode(String tagCode) {
        this.tagCode = tagCode;
    }

    @Basic
    @Column(name = "tag_name", nullable = true, length = 32)
    public String getTagName() {
        return tagName;
    }

    public void setTagName(String tagName) {
        this.tagName = tagName;
    }

    @Basic
    @Column(name = "tag_name_en", nullable = true, length = 32)
    public String getTagNameEn() {
        return tagNameEn;
    }

    public void setTagNameEn(String tagNameEn) {
        this.tagNameEn = tagNameEn;
    }

    @Basic
    @Column(name = "tag_type", nullable = true, length = 32)
    public String getTagType() {
        return tagType;
    }

    public void setTagType(String tagType) {
        this.tagType = tagType;
    }

    @Basic
    @Column(name = "descript", nullable = true, length = 255)
    public String getDescript() {
        return descript;
    }

    public void setDescript(String descript) {
        this.descript = descript;
    }

    @Basic
    @Column(name = "descript_en", nullable = true, length = 255)
    public String getDescriptEn() {
        return descriptEn;
    }

    public void setDescriptEn(String descriptEn) {
        this.descriptEn = descriptEn;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TagBase tagBase = (TagBase) o;

        if (tagCode != null ? !tagCode.equals(tagBase.tagCode) : tagBase.tagCode != null) return false;
        if (tagName != null ? !tagName.equals(tagBase.tagName) : tagBase.tagName != null) return false;
        if (tagType != null ? !tagType.equals(tagBase.tagType) : tagBase.tagType != null) return false;
        if (descript != null ? !descript.equals(tagBase.descript) : tagBase.descript != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = tagCode != null ? tagCode.hashCode() : 0;
        result = 31 * result + (tagName != null ? tagName.hashCode() : 0);
        result = 31 * result + (tagType != null ? tagType.hashCode() : 0);
        result = 31 * result + (descript != null ? descript.hashCode() : 0);
        return result;
    }
}
